package com.pi.dc.model;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.NotBlank;

import com.alibaba.fastjson.JSON;
import com.pi.dc.enumerate.CmdForwordEnum;
import com.pi.dc.enumerate.CmdTypeEnum;

public class DcLogPostForm{
  //来源， 用作各个来源的数据查询, 不为空时, 是对应特定的定制app或者单一应用,如果为空, 系统需要根据deviceCode查询
  @Min(value = 1 , message = "REQ_COMMON.SOURCE_ID_EMPTY")
  private Long              sourceId;
  @NotNull
  @Min(value = 1 , message = "DC_INS.CMD_ID_EMPTY")
  private Long              cmdId;                    // 消息流水的编号 
  @NotBlank(message = "DC_INS.DEV_CODE_EMPTY")
  private String            devCode;                  // 设备的编号
  @NotBlank(message = "DC_INS.RAW_DATA_EMPTY")
  private String            rawData;                  // 原始数据
  /**
   * 指令方向
   */
  @NotNull
  private CmdForwordEnum cmdForwordEnum;
  /**
   * 指令类型
   */
  @NotNull
  private CmdTypeEnum cmdTypeEnum;
  
  public Long getSourceId() {
    return sourceId;
  }
  public void setSourceId(Long sourceId) {
    this.sourceId = sourceId;
  }
  public Long getCmdId() {
    return cmdId;
  }
  public void setCmdId(Long cmdId) {
    this.cmdId = cmdId;
  }
  public String getDevCode() {
    return devCode;
  }
  public void setDevCode(String devCode) {
    this.devCode = devCode;
  }
  public String getRawData() {
    return rawData;
  }
  public void setRawData(String rawData) {
    this.rawData = rawData;
  }
  @Override
  public String toString() {
    return JSON.toJSONString(this);
  }
}
